package com.hutu.kboshi.adapter;


import com.hutu.kboshi.pojo.dto.questionbank.QuestionBankAddRequest;
import com.hutu.kboshi.pojo.dto.questionbank.QuestionBankEditRequest;
import com.hutu.kboshi.pojo.dto.questionbank.QuestionBankUpdateRequest;
import com.hutu.kboshi.pojo.entity.QuestionBank;

public class QuestionBankBuilder {

    public static QuestionBank builderQuestionBankAddRequestToQuestionBank(QuestionBankAddRequest request){
        QuestionBank questionBank = new QuestionBank();
        questionBank.setTitle(request.getTitle());
        questionBank.setDescription(request.getDescription());
        questionBank.setPicture(request.getPicture());
        return questionBank;
    }

    public static QuestionBank builderQuestionBankUpdateRequestToQuestionBank(QuestionBankUpdateRequest questionBankUpdateRequest) {
        QuestionBank questionBank = new QuestionBank();
        questionBank.setId(questionBankUpdateRequest.getId());
        questionBank.setTitle(questionBankUpdateRequest.getTitle());
        questionBank.setDescription(questionBankUpdateRequest.getDescription());
        questionBank.setPicture(questionBankUpdateRequest.getPicture());
        return questionBank;
    }

    public static QuestionBank builderQuestionBankEditRequestToQuestionBank(QuestionBankEditRequest request){
        QuestionBank questionBank = new QuestionBank();
        questionBank.setId(request.getId());
        questionBank.setTitle(request.getTitle());
        questionBank.setDescription(request.getDescription());
        questionBank.setPicture(request.getPicture());
        return questionBank;
    }
}
